home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / df8txt.zip / DFLAT.DOC next >
Text File  |  1991-09-30  |  47KB  |  1,250 lines

  1. Window Classes:
  2.  
  3. Window classes define the behavior of windows. Each class has its own
  4. unique reaction to messages. Classes derive from other classes.
  5.  
  6.     NORMAL       base window for all window classes
  7.     APPLICATION  application window. has the menu 
  8.                  (derived from NORMAL)
  9.     TEXTBOX      textbox. base window for listbox, editbox, etc.
  10.                  (derived from NORMAL)
  11.     LISTBOX      listbox. base window for menubar
  12.                  (derived from TEXTBOX)
  13.     PICTUREBOX   picturebox. a text box onto which you can draw lines
  14.                  (derived from TEXTBOX)
  15.     EDITBOX      editbox
  16.                  (derived from TEXTBOX)
  17.     MENUBAR      the application's menu bar
  18.                  (derived from NORMAL)
  19.     POPDOWNMENU  popdown menu
  20.                  (derived from LISTBOX)
  21.     BUTTON       command button in a dialog box
  22.                  (derived from TEXTBOX)
  23.     SPINBUTTON   spin button in a dialog box
  24.                  (derived from LISTBOX)
  25.     COMBOBOX     combination editbox/listbox
  26.          (derived from EDITBOX)
  27.     DIALOG       dialog box. parent to editbox, button, listbox, etc.
  28.                  (derived from NORMAL)
  29.     ERRORBOX     for displaying an error message
  30.                  (derived from DIALOG)
  31.     MESSAGEBOX   for displaying a message
  32.                  (derived from DIALOG)
  33.     HELPBOX      help window
  34.                  (derived from DIALOG)
  35.     TEXT         static text on a dialog box
  36.                  (derived from TEXTBOX)
  37.     RADIOBUTTON  radio button on a dialog box
  38.                  (derived from TEXTBOX)
  39.     CHECKBOX     check box on a dialog box
  40.                  (derived from TEXTBOX)
  41.     STATUSBAR    status bar at the bottom of application window
  42.                  (derived from TEXTBOX)
  43.  
  44.                D-Flat Window Class Tree
  45.     ┌─────────────────────────────────────────────┐
  46.     │                                             │
  47.     │      NORMAL                                 │
  48.     │        │                                    │
  49.     │        ├── APPLICATION                      │
  50.     │        │                                    │
  51.     │        ├── MENUBAR                          │
  52.     │        │                                    │
  53.     │        ├── TEXTBOX                          │
  54.     │        │      │                             │
  55.     │        │      ├── LISTBOX                   │
  56.     │        │      │      │                      │
  57.     │        │      │      ├──── POPDOWNMENU      │
  58.     │        │      │      │                      │
  59.     │        │      │      └──── SPINBUTTON       │
  60.     │        │      │                             │
  61.     │        │      ├── EDITBOX                   │
  62.     │        │      │      │                      │
  63.     │        │      │      └──── COMBOBOX         │
  64.     │        │      │                             │
  65.     │        │      ├── PICTUREBOX                │
  66.     │        │      │                             │
  67.     │        │      ├── STATUSBAR                 │
  68.     │        │      │                             │
  69.     │        │      ├── TEXT                      │
  70.     │        │      │                             │
  71.     │        │      ├── BUTTON                    │
  72.     │        │      │                             │
  73.     │        │      ├── RADIOBUTTON               │
  74.     │        │      │                             │
  75.     │        │      └── CHECKBOX                  │
  76.     │        │                                    │
  77.     │        └── DIALOG                           │
  78.     │              │                              │
  79.     │              ├── ERRORBOX                   │
  80.     │              │                              │
  81.     │              ├── MESSAGEBOX                 │
  82.     │              │                              │
  83.     │              └── HELPBOX                    │
  84.     │                                             │
  85.     └─────────────────────────────────────────────┘
  86.  
  87.  
  88. Window Attributes:
  89.  
  90. Every window has an attribute word that defines some of its
  91. appearance and behavior. The following values are bitwise flags that
  92. OR together to make a window's attributes.
  93.  
  94. You can establish default attributes for a window's class, add
  95. additional attributes when you create the window, and use the
  96. AddAttribute, ClearAttribute, and TestAttribute macros to change and
  97. test a window's attributes.
  98.  
  99.     SHADOW       has a shadow
  100.     MOVEABLE     can move the window with mouse or cursor
  101.     SIZEABLE     can resize the window with mouse or cursor
  102.     HASMENUBAR   has a menubar (an application window)
  103.     VSCROLLBAR   has a vertical scroll bar
  104.     HSCROLLBAR   has a horizontal scroll bar
  105.     VISIBLE      is visible
  106.     SAVESELF     saves its own video memory
  107.     TITLEBAR     has a title bar 
  108.     CONTROLBOX   has a control box and control menu
  109.     MINMAXBOX    has a min/max box 
  110.     NOCLIP       is not clipped to its parent's borders
  111.     READONLY     is a readonly textbox
  112.     MULTILINE    is a multiline editbox or listbox
  113.     HASBORDER    has a border
  114.     HASSTATUSBAR has a statusbar (application window only)
  115.  
  116. Messages:
  117.  
  118. A D-Flat program is message-driven. You initiate message processing
  119. with the init_messages function, create a window with the
  120. CreateWindow function, and go into the message dispatching loop with
  121. the dispatch_message function. 
  122.  
  123. A window can have a window-processing function. When the user causes
  124. events to occur by pressing keys and using the mouse, D-Flat sends
  125. messages to the window's function. That function can send messages to
  126. itself and other windows with the SendMessage and PostMessage
  127. functions.
  128.  
  129. Windows are declared as members of a class. Every class has a default
  130. window-processing function. If you do not provide one for an instance
  131. of a window class, the default one receives messages for the window.
  132. Your custom window-processing function--if one exists--should chain to
  133. the default window-processing function for the blass by calling the
  134. DefaultWndProc function.
  135.  
  136. There are five things a window-processing function can do with a
  137. message:
  138.   - ignore it and let the D-Flat default processing occur.
  139.   - suppress it by returning without chaining to the default
  140.     window-processing function for the window class.
  141.   - chain to the default window-processing function and then do some
  142.     additional processing.
  143.   - do some preliminary processing and then chain to the default
  144.     window-processing function.
  145.   - do all the processing of the message and then return without 
  146.     chaining to the default window-processing function for the 
  147.     window class.
  148.  
  149. Following are the messages that an application program would use.
  150. There are other messages, but they are used by D-Flat only.
  151.  
  152. Process Communication Messages  
  153.  
  154. START                  start message processing (not used now)
  155.   Sent:    
  156.   P1:      
  157.   P2:      
  158.   Returns: 
  159.  
  160. STOP                   stop message processing        
  161.   Sent:    by application window to NULLWND to stop message 
  162.            dispatch loop
  163.   P1:      
  164.   P2:      
  165.   Returns: 
  166.  
  167. COMMAND                send a command to a window
  168.   Sent:    to send command
  169.   P1:      command code (commands.h)
  170.   P2:      additional data (command-dependent)
  171.            If the command code is a menu selection, P2 is the
  172.            position of the selection on the menu (1,2,...)
  173.            If the command code is a dialog box control, P2 is
  174.            ENTERFOCUS when the command gets the focus, LEAVEFOCUS
  175.            when the command loses the focus, and 0 when the user
  176.            executes the control's command, e.g. presses a button.
  177.   Returns: Nothing if sent by PostCommand
  178.            Command-dependent value if sent by SendCommand
  179.  
  180.  
  181. Window Management Messages  
  182.  
  183. CREATE_WINDOW          create a window                
  184.   Sent:    by DFLAT to new window after window is created
  185.   P1:      
  186.   P2:      
  187.   Returns: 
  188.  
  189. SHOW_WINDOW            show a window                  
  190.   Sent:    by the app to the window to display the window
  191.   P1:      
  192.   P2:      
  193.   Returns: 
  194.  
  195. HIDE_WINDOW            hide a window                  
  196.   Sent:    by the app to the window to hide the window
  197.   P1:      
  198.   P2:      
  199.   Returns: 
  200.  
  201. CLOSE_WINDOW           delete a window                
  202.   Sent:    by the app to destroy a window
  203.   P1:      
  204.   P2:      
  205.   Returns: 
  206.  
  207. SETFOCUS               set and clear the focus        
  208.   Sent:    by D-Flat or the app to set or release the focus
  209.   P1:      true = set, false = release
  210.   P2:      
  211.   Returns: 
  212.  
  213. PAINT                  paint the window's data space  
  214.   Sent:    to paint the client area of a window
  215.   P1:      address of RECT relative to window (0/0 = upper left) 
  216.            to paint or 0 to paint entire client area
  217.   P2:      
  218.   Returns: 
  219.  
  220. BORDER                 paint the window's border      
  221.   Sent:    to paint a window's border
  222.   P1:      address of RECT relative to window (0/0 = upper left) 
  223.            to paint or 0 to paint entire border
  224.   P2:      
  225.   Returns: FALSE to suppress D-Flat title display 
  226.            (e.g. the window displays its own border)
  227.  
  228. TITLE                  display the window's title     
  229.   Sent:    by D-Flat when it is about to display a window's title
  230.   P1:      address of RECT relative to window (0/0 = upper left) 
  231.            to paint or 0 to paint entire title
  232.   P2:      
  233.   Returns: FALSE to suppress D-Flat title display 
  234.            (e.g. the window displays its own title)
  235.  
  236. MOVE                   move the window                
  237.   Sent:    to move a window
  238.   P1:      new left coordinate
  239.   P2:      new upper coordinate
  240.   Returns: 
  241.  
  242. SIZE                   change the window's size       
  243.   Sent:    to resize a window
  244.   P1:      new right coordinate
  245.   P2:      new lower coordinate
  246.   Returns: 
  247.  
  248. MAXIMIZE               maximize the window            
  249.   Sent:    to maximize a window within its parent's client area
  250.   P1:      
  251.   P2:      
  252.   Returns: 
  253.  
  254. MINIMIZE               minimize the window            
  255.   Sent:    to minimize a window to an icon 
  256.   P1:      
  257.   P2:      
  258.   Returns: 
  259.  
  260. RESTORE                restore the window             
  261.   Sent:    to restore a window to its position and size prior to the
  262.            maximize or minimize operation
  263.   P1:      
  264.   P2:      
  265.   Returns: 
  266.  
  267. INSIDE_WINDOW          test x/y inside a window       
  268.   Sent:    to test to see if coordinates are inside a window
  269.   P1:      x
  270.   P2:      y
  271.   Returns: true or false
  272.  
  273.  
  274. Clock Messages  
  275.  
  276. CLOCKTICK              the clock ticked               
  277.   Sent:    every second to a window that has captured the clock
  278.   P1:      segment of time display string
  279.   P2:      offset of time display string
  280.   Returns: 
  281.  
  282. CAPTURE_CLOCK          capture clock into a window    
  283.   Sent:    to capture the clock
  284.   P1:      
  285.   P2:      
  286.   Returns: 
  287.  
  288. RELEASE_CLOCK          release clock to the system    
  289.   Sent:    to release the captured clock
  290.   P1:      
  291.   P2:      
  292.   Returns: 
  293.  
  294.  
  295. Keyboard and Screen Messages  
  296.  
  297. KEYBOARD               key was pressed                
  298.   Sent:    when key is pressed. sent to the window that has the focus 
  299.   P1:      keystroke
  300.   P2:      shift key mask
  301.   Returns: 
  302.  
  303. CAPTURE_KEYBOARD       capture keyboard into a window 
  304.   Sent:    by window to itself to capture the keyboard 
  305.            regardless of focus
  306.   P1:      
  307.   P2:      
  308.   Returns: 
  309.  
  310. RELEASE_KEYBOARD       release keyboard to system     
  311.   Sent:    by window to itelf to release the captured keyboard
  312.   P1:      
  313.   P2:      
  314.   Returns: 
  315.  
  316. KEYBOARD_CURSOR        position the keyboard cursor   
  317.   Sent:    to position the keyboard cursor
  318.   P1:      x (if sent by window, 0 = left client area)
  319.   P2:      y (if sent by window, 0 = top client area)
  320.            if sent with NULLWND, x/y are relative to the screen
  321.   Returns: 
  322.  
  323. CURRENT_KEYBOARD_CURSOR    read the cursor position
  324.   Sent:    to retrieve the cursor position
  325.   P1:      x (relative to the screen)
  326.   P2:      y (relative to the screen)
  327.   Returns: 
  328.  
  329. HIDE_CURSOR            hide the keyboard cursor       
  330.   Sent:    to hide the keyboard cursor
  331.   P1:      
  332.   P2:      
  333.   Returns: 
  334.  
  335. SHOW_CURSOR            display the keyboard cursor    
  336.   Sent:    to display the keyboard cursor
  337.   P1:      
  338.   P2:      
  339.   Returns: 
  340.  
  341. SAVE_CURSOR            save the cursor's configuration
  342.   Sent:    to save the keyboard cursor's current configuration 
  343.   P1:      
  344.   P2:      
  345.   Returns: 
  346.  
  347. RESTORE_CURSOR         restore the saved cursor       
  348.   Sent:    to restore a keyboard cursor's saved configuration 
  349.   P1:      
  350.   P2:      
  351.   Returns: 
  352.  
  353. SHIFT_CHANGED          the shift status changed       
  354.   Sent:    to in-focus window when the user presses or 
  355.            releases shift, alt, or ctrl key
  356.   P1:      BIOS shift key mask
  357.   P2:      
  358.   Returns: 
  359.  
  360. WAITKEYBOARD            wait for key release
  361.   Sent:    to wait for a keypress release
  362.   P1:
  363.   P2:      
  364.   Returns: 
  365.  
  366.  
  367. Mouse Messages  
  368.  
  369. RESET_MOUSE            reset the mouse
  370.   Sent:    to reset the mouse to the current screen configuration
  371.   P1:
  372.   P2:      
  373.   Returns: 
  374.  
  375. MOUSE_TRAVEL        set the mouse's travel
  376.   Sent:    to limit the mouse travel to a screen rectangle
  377.   P1:      address of a RECT
  378.   P2:      
  379.   Returns: 
  380.  
  381. MOUSE_INSTALLED        test for mouse installed       
  382.   Sent:    to see if the mouse is installed
  383.   P1:      
  384.   P2:      
  385.   Returns: true or false
  386.  
  387. RIGHT_BUTTON           right button pressed           
  388.   Sent:    to window when the user presses the right button
  389.            (sent only when mouse cursor is within the window
  390.             or the window has captured the mouse)
  391.   P1:      x
  392.   P2:      y
  393.   Returns: 
  394.  
  395. LEFT_BUTTON            left button pressed            
  396.   Sent:    to window when the user presses the left button
  397.            (sent only when mouse cursor is within the window
  398.             or the window has captured the mouse)
  399.   P1:      x
  400.   P2:      y
  401.   Returns: 
  402.  
  403. DOUBLE_CLICK           left button doubleclicked    
  404.   Sent:    to window when the user double-clicks the left button
  405.            (sent only when mouse cursor is within the window
  406.             or the window has captured the mouse)
  407.            (a LEFT_BUTTON message will have preceded this one)
  408.   P1:      x
  409.   P2:      y
  410.   Returns: 
  411.  
  412. MOUSE_MOVED            mouse changed position         
  413.   Sent:    to window when the mouse has moved
  414.            (sent only when mouse cursor is within the window
  415.             or the window has captured the mouse)
  416.   P1:      x
  417.   P2:      y
  418.   Returns: 
  419.  
  420. BUTTON_RELEASED        mouse button released          
  421.   Sent:    to window when user releases mouse button
  422.            (sent only when mouse cursor is within the window
  423.             or the window has captured the mouse)
  424.   P1:      x
  425.   P2:      y
  426.   Returns: 
  427.  
  428. CURRENT_MOUSE_CURSOR   get mouse position             
  429.   Sent:    to determine the current mouse position
  430.   P1:      address of x
  431.   P2:      address of y
  432.   Returns: 
  433.  
  434. MOUSE_CURSOR           set mouse position             
  435.   Sent:    to set the current mouse position
  436.   P1:      x
  437.   P2:      y
  438.   Returns: 
  439.  
  440. SHOW_MOUSE             make mouse cursor visible      
  441.   Sent:    to display the mouse cursor
  442.   P1:      
  443.   P2:      
  444.   Returns: 
  445.  
  446. HIDE_MOUSE             hide mouse cursor              
  447.   Sent:    to hide the mouse cursor
  448.   P1:      
  449.   P2:      
  450.   Returns: 
  451.  
  452. WAITMOUSE              wait until button released     
  453.   Sent:    to wait until the user releases the mouse button
  454.   P1:      
  455.   P2:      
  456.   Returns: 
  457.  
  458. TESTMOUSE              test any mouse button pressed  
  459.   Sent:    to see if either mouse button is pressed
  460.   P1:      
  461.   P2:      
  462.   Returns: true or false
  463.  
  464. CAPTURE_MOUSE          capture mouse into a window    
  465.   Sent:    by/to a window to capture all mouse activity 
  466.            regardless of whether it occurs inside this window
  467.   P1:      
  468.   P2:      
  469.   Returns: 
  470.  
  471. RELEASE_MOUSE          release the mouse to system    
  472.   Sent:    release a captured mouse
  473.   P1:      
  474.   P2:      
  475.   Returns: 
  476.  
  477.  
  478. Text Box Messages  
  479.  
  480. ADDTEXT                add text to the text box       
  481.   Sent:    to append a line of text to the text box
  482.   P1:      address of null-terminated string 
  483.            (textbox makes its own copy. string can go out of scope.)
  484.   P2:      
  485.   Returns: 
  486.  
  487. CLEARTEXT              clear the text box             
  488.   Sent:    clear all text from the text box
  489.   P1:      
  490.   P2:      
  491.   Returns: 
  492.  
  493. SETTEXT                set address of text buffer     
  494.   Sent:    To set text buffer to caller's text.
  495.   P1:      address of text buffer
  496.            (lines are terminated by \n without \0)
  497.            (textbox makes its own copy. string can go out of scope.)
  498.   P2:      length of text buffer
  499.   Returns: 
  500.  
  501. SCROLL                 vertical scroll of text box    
  502.   Sent:    to scroll a text window vertically one line
  503.   P1:      true = scroll up, false = scroll down
  504.   P2:
  505.   Returns: 
  506.  
  507. HORIZSCROLL            horizontal scroll of text box 
  508.   Sent:    to scroll a text window horizontally one column
  509.   P1:      true = scroll left, false = scroll right
  510.   P2:
  511.   Returns: 
  512.  
  513. SCROLLPAGE             vertical scroll of text box 1 page
  514.   Sent:    to scroll a text window vertically one page
  515.   P1:      true = scroll up, false = scroll down
  516.   P2:
  517.   Returns: 
  518.  
  519. HORIZSCROLLPAGE        horizontal scroll of text box 1 page
  520.   Sent:    to scroll a text window horizontally one page
  521.   P1:      true = scroll left, false = scroll right
  522.   P2:
  523.   Returns: 
  524.  
  525. SCROLLDOC             document scroll of text box
  526.   Sent:    to scroll a text window to beginning/end of document
  527.   P1:      true = scroll to beginning, false = scroll to end
  528.   P2:
  529.   Returns: 
  530.  
  531. Edit Box Messages  
  532.  
  533. EB_GETTEXT             get text from an edit box      
  534.   Sent:    Get the line of text from a single-line editbox
  535.   P1:      address of receiving buffer
  536.   P2:      max length to copy
  537.   Returns: 
  538.  
  539. EB_PUTTEXT             put text into an edit box      
  540.   Sent:    replace old or insert first text into an editbox
  541.   P1:      address of text (null-terminated string)
  542.   P2:      
  543.   Returns: 
  544.  
  545.  
  546. Application Window Messages
  547.  
  548. ADDSTATUS               write text to the status bar
  549.   Sent:    to write to or clear status bar text area
  550.   P1:      address of text (null-terminated string) or NULL to clear
  551.   P2:      
  552.   Returns: 
  553.  
  554. List Box Messages  
  555.  
  556. LB_SELECTION               list box selection
  557.   Sent:    sent by list box to self and to parent (if parent is not
  558.            a simple LISTBOX window) when user moves to an entry on 
  559.            the list box.
  560.   P1:      selection number: 0, 1, ...
  561.   P2:      if multi-line selection listbox, shift status mask
  562.            if not, true = selection was same as choice (e.g. mouse)
  563.   Returns: 
  564.  
  565. LB_CHOOSE               list box choice        
  566.   Sent:    sent to parent of list box when user chooses an item 
  567.            from the list box
  568.   P1:      selection number: 0, 1, ...
  569.   P2:      
  570.   Returns: 
  571.  
  572. LB_CURRENTSELECTION    return the current selection   
  573.   Sent:    To get the current selection number (where the listbox
  574.            cursor is positioned)
  575.   P1:      
  576.   P2:      
  577.   Returns: selection number: 0, 1, ...
  578.  
  579. LB_GETTEXT             return the text of selection   
  580.   Sent:    To get a copy of the text at a specified line
  581.   P1:      Address of string to receive copy of text
  582.   P2:      Line number: 0, 1, ...
  583.   Returns: 
  584.  
  585. LB_SETSELECTION        sets the listbox selection     
  586.   Sent:    To change where the listbox cursor points
  587.   P1:      Line number: 0, 1, ...
  588.   P2:      
  589.   Returns: 
  590.  
  591. Picture Box Messages
  592.  
  593. DRAWVECTOR           Draws a vector
  594.   Sent:    To draw a vector in the window's client area
  595.   P1:      address of RECT that describes the vector relative to the
  596.            window's client area
  597.            (either lf = rt [vertical vector] or tp = bt [horizontal
  598.            vector])
  599.   P2:      
  600.   Returns: 
  601.  
  602. DRAWBOX             Draws a box
  603.   Sent:    To draw a box in the window's client area
  604.   P1:      address of RECT that describes the box relative to the
  605.            window's client area
  606.   P2:      
  607.   Returns: 
  608.  
  609. DRAWBAR             Draws a barchart bar
  610.   Sent:    To draw a bar in the window's client area
  611.   P1:      address of RECT that describes the bar relative to the
  612.            window's client area
  613.            (either lf = rt [vertical vector] or tp = bt [horizontal
  614.            vector])
  615.   P2:      one of these: SOLIDBAR, HEAVYBAR, CROSSBAR, LIGHTBAR
  616.              (4 different bar textures)
  617.   Returns: 
  618.  
  619. =====================================================
  620.  
  621. API Functions & Macros:
  622.  
  623. These are functions and macros defined for use by applications
  624. programs. There are many others defined in the header files. These
  625. others are for D-Flat to use, and programmers need not be concerned
  626. about them except as an expression of their curiosity about how
  627. D-Flat works.
  628.  
  629.  
  630. (Note: These specifications are not in any orderly sequence yet.)
  631.  
  632.  
  633. -------------------------------------------------------------------
  634. void init_messages(void)
  635.  
  636. Call this function first to initialize message processing
  637.  
  638. -------------------------------------------------------------------
  639. WINDOW CreateWindow(
  640.     CLASS class,              /* class of this window       */
  641.     char *ttl,                /* title or NULL              */
  642.     int left, int top,        /* upper left coordinates     */
  643.     int height, int width,    /* dimensions                 */
  644.     void *extension,          /* pointer to additional data */
  645.     WINDOW parent,            /* parent of this window      */
  646.     int (*wndproc)(struct window *,MESSAGE,PARAM,PARAM),
  647.     int attrib)               /* window attribute           */
  648.  
  649. This function creates a window. It returns the WINDOW handle that
  650. mesages and functions use to identify the window.
  651.  
  652. -------------------------------------------------------------------
  653. void PostMessage(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  654.  
  655. Post a message to a window. The window will receive the message in
  656. turn during the message-dispatching loop.
  657.  
  658. -------------------------------------------------------------------
  659. int SendMessage(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  660.  
  661. Send a message to a window. The window will receive the message
  662. immediately. Control returns to the sender after the window has
  663. processed the message. The window can return an integer value.
  664.  
  665. This function can send system messages to NULLWND. System messages
  666. are ones that D-Flat processes without regard to a particular window.
  667. -------------------------------------------------------------------
  668. int dispatch_message(void)
  669.  
  670. The message dispatching loop. After opening the first window (usually
  671. the applications window), continue to call this function until it
  672. returns a FALSE value.
  673. -------------------------------------------------------------------
  674. int TestCriticalError(void)
  675.  
  676. -------------------------------------------------------------------
  677. int DefaultWndProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  678.  
  679. Call this from a window-processing function to chain to the default
  680. window-processing function for the window's class.
  681.  
  682. -------------------------------------------------------------------
  683. int BaseWndProc(CLASS class, WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  684.  
  685. Call this from the window-processing function of a derived window
  686. class to chain to the window-processing function of the base window's
  687. class.
  688.  
  689. -------------------------------------------------------------------
  690. int WindowHeight(WINDOW wnd)
  691. int WindowWidth(WINDOW wnd)
  692.  
  693. These functions return the window's height and width.
  694. -------------------------------------------------------------------
  695. int ClientWidth(WINDOW wnd)
  696. int ClientHeight(WINDOW wnd)
  697.  
  698. These functions return the height and width of the window's client
  699. area.
  700.  
  701. -------------------------------------------------------------------
  702. int GetTop(WINDOW wnd)
  703. int GetBottom(WINDOW wnd)
  704. int GetLeft(WINDOW wnd)
  705. int GetRight(WINDOW wnd)
  706.  
  707. These functions return the screen coordinates of the four corners of
  708. the window.
  709.  
  710. -------------------------------------------------------------------
  711. int GetClientTop(WINDOW wnd)
  712. int GetClientBottom(WINDOW wnd)
  713. int GetClientLeft(WINDOW wnd)
  714. int GetClientRight(WINDOW wnd)
  715.  
  716. These functions return the screen coordinates of the four corners of
  717. the window's client area.
  718.  
  719. -------------------------------------------------------------------
  720. WINDOW GetParent(WINDOW wnd)
  721.  
  722. Returns the parent of the window or NULLWND if the window has no
  723. parent.
  724. -------------------------------------------------------------------
  725. WINDOW GetFirstChild(WINDOW pwnd)
  726.  
  727. Returns the first child of a parent window or NULLWND if the window
  728. has no children.
  729.  
  730. -------------------------------------------------------------------
  731. WINDOW GetNextChild(WINDOW pwnd, WINDOW cwnd)
  732.  
  733. Call this function repetitively after GetFirstChild. It returns the
  734. next child window after the one specified in the second parameter. If
  735. there are no more children, the function returns NULLWND.
  736.  
  737. -------------------------------------------------------------------
  738. WINDOW GetLastChild(WINDOW pwnd)
  739.  
  740. Returns the last child of a p`rent window or NULLWND if the window
  741. has no children.
  742.  
  743. -------------------------------------------------------------------
  744. WINDOW GetPrevChild(WINDOW pwnd, WINDOW wnd)
  745.  
  746. Call this function repetitively after GetLastChild. It returns the
  747. previous child window before the one specified in the second
  748. parameter. If there are no more children, the function returns
  749. NULLWND.
  750.  
  751. -------------------------------------------------------------------
  752. int CharInView(WINDOW wnd, int x, int y)
  753.  
  754. Returns true if the x/y character position, relative to the window,
  755. is in view (not clipped at the border of a parent window or the
  756. screen.
  757.  
  758. -------------------------------------------------------------------
  759. int TopBorderAdj(WINDOW wnd)
  760.  
  761. Returns the value to add to a y coordinate of the window's client
  762. area to make it relative to the window top.
  763.  
  764. -------------------------------------------------------------------
  765. int BorderAdj(WINDOW wnd)
  766.  
  767. Returns the value to add to an x coordinate relative to the window's
  768. client area to make it relative to the window's left edge.
  769.  
  770. -------------------------------------------------------------------
  771. char *GetTitle(WINDOW wnd)
  772.  
  773. Returns the address of a window's title, or NULL if the window has no
  774. title.
  775.  
  776. -------------------------------------------------------------------
  777. void AddTitle(WINDOW wnd, char *title)
  778.  
  779. Adds or changes the title to an existing window.
  780.  
  781. -------------------------------------------------------------------
  782. CLASS GetClass(WINDOW wnd)
  783.  
  784. Returns the class of the window.
  785.  
  786. -------------------------------------------------------------------
  787. int GetAttribute(WINDOW wnd)
  788.  
  789. Returns the attribute word of a window.
  790.  
  791. -------------------------------------------------------------------
  792. void AddAttribute(WINDOW wnd, int attrib)
  793.  
  794. Adds one or more attributes to a window. OR the attribute values
  795. together.
  796.  
  797. -------------------------------------------------------------------
  798. void ClearAttribute(WINDOW wnd, int attrib)
  799.  
  800. Clears one or more attributes from a window. OR the attribute values
  801. together.
  802.  
  803. -------------------------------------------------------------------
  804. int TestAttribute(WINDOW wnd, int attrib)
  805.  
  806. Tests one or more attributes in a window. Returns true if any of them
  807. are set. OR the attribute values together.
  808.  
  809. -------------------------------------------------------------------
  810. int isVisible(WINDOW wnd)
  811.  
  812. Returns true if the window is visible.
  813.  
  814. -------------------------------------------------------------------
  815. char *GetText(WINDOW wnd)
  816.  
  817. Returns the address of the text buffer for a TEXTBOX or derived
  818. window class.
  819.  
  820. -------------------------------------------------------------------
  821. char *TextLine(WINDOW wnd, int line)
  822.  
  823. Returns the address of a specified line of text (0, 1, ...) in a
  824. TEXTBOX or derived class.
  825.  
  826. -------------------------------------------------------------------
  827. WINDOW inWindow(int x, int y)
  828.  
  829. Returns the WINDOW handle of the window that x/y are in or NULL if
  830. x/y is outside of any window.
  831.  
  832. -------------------------------------------------------------------
  833. int isActive(MENU *mnu, int command)
  834.  
  835. Returns true if the command (commands.h) on the menu is active
  836. (enabled).
  837.  
  838. -------------------------------------------------------------------
  839. char *GetCommandText(MBAR *mn, int cmd)
  840.  
  841. Returns the address of a menu command's title text.
  842.  
  843. -------------------------------------------------------------------
  844. void ActivateCommand(MENU *mnu, int command)
  845. void DeactivateCommand(MENU *mnu, int command)
  846.  
  847. Activate (enable) or deactivate (disable) a command (commands.h) on a
  848. menu.
  849.  
  850. -------------------------------------------------------------------
  851. int GetCommandToggle(MENU *mnu, int command)
  852. void SetCommandToggle(MENU *mnu, int command)
  853. void ClearCommandToggle(MENU *mnu, int command)
  854. void InvertCommandToggle(MENU *mnu, int command)
  855.  
  856. Some menu commands are toggles rather than executors of processes. 
  857. Examples are the Insert and Word wrap commands on the Options menu.
  858. These functions get, set, clear, and invert the toggle setting for a
  859. specified command on a specified menu.
  860.  
  861. -------------------------------------------------------------------
  862. int ItemSelected(WINDOW wnd, int line)
  863.  
  864. This function returns true if the specified item (0, 1, ...) on a
  865. multiple-line selection listbox is selected.
  866.  
  867. -------------------------------------------------------------------
  868. int DialogBox(
  869.   WINDOW wnd,        /* parent window of the dialog box        */
  870.   DBOX *db,          /* address of dialog box definition array */
  871.   int Modal,         /* trus if it is a modal dialog box       */
  872.   int (*wndproc)(struct window *, MESSAGE, PARAM, PARAM)
  873.                      /* the window processing function or NULL */
  874. )
  875.  
  876. This function executes a dialog box. If it is a modal dialog box, the
  877. function does not return until the user completes the dialog box. The
  878. return value will be true if the user has selected OK and false if
  879. the user has selected Cancel on the dialog box. If the dialog box is
  880. modeless, the function returns immediately, and the user can select
  881. other things from the screen while the dialog box is still active.
  882.  
  883. -------------------------------------------------------------------
  884. WINDOW ControlWindow(DBOX *db, enum commands cmd)
  885.  
  886. This function returns the WINDOW handle of the control specified by
  887. the cmd parameter.
  888. -------------------------------------------------------------------
  889. int DlgOpenFile(char *filespec, char *filename)
  890.  
  891. This function operates the Open File dialog box. The filespec pointer
  892. points to a default file path specification that the dialog box uses
  893. to display files, for example, *.DOC. If the function returns true,
  894. the space pointed to by the filename pointer will contain the path
  895. and filename selected by the user to be read.
  896.  
  897. -------------------------------------------------------------------
  898. int DlgSaveAs(char *filename)
  899.  
  900. This function operates the Save As dialog box. If the function returns
  901. true, the space pointed to by the filename pointer will contain the
  902. path and filename selected by the user where the file will be
  903. written.
  904.  
  905. -------------------------------------------------------------------
  906. void MessageBox(char *title, char *message)
  907. void CancelBox(wnd, char *message)
  908. void ErrorMessage(char *message)
  909. int TestErrorMessage(char *message)
  910. int YesNoBox(char *question)
  911. WINDOW MomentaryMessage(char *message)
  912.  
  913. These functions display generic message boxes. The message text is
  914. one null-terminated string with newlines (\n) to indicate where lines
  915. are to be broken. The size of the boxes adjusts to the width of the
  916. longest line and the number of lines of text. A message may have no
  917. more lines of text than will fit into the largest window that the
  918. screen can display. You must account for the window's border's and
  919. the presence at the bottom of one or more command buttons.
  920.  
  921. The MessageBox function displays a message in a window with a title
  922. provided by the caller. The window contains the message and an OK
  923. command button.
  924.  
  925. The CancelBox function displays a message in a window with a
  926. "Wait..." title. The window contains the message and a Cancel command
  927. button. If the user presses the Cancel button before the program
  928. closes the window, the COMMAND, ID_CANCEL message is sent to the
  929. parent window.
  930.  
  931. The ErrorMessage function displays the message in an error box window
  932. with an OK command button.
  933.  
  934. The TestErrorMessage function is an error message with OK and Cancel
  935. command buttons. The function returns true if the user selects OK or
  936. presses Enter and false if the user selects Cancel or presses Esc.
  937.  
  938. The YesNoBox function displays the message with Yes and No command
  939. buttons. The function returns true if the user selects Yes or
  940. presses Enter and false if the user selects No or presses Esc.
  941.  
  942. The MomentaryMessage function displays a message box and returns its
  943. WINDOW handle. The caller must close the window. The purpose of this
  944. function is to allow you to display a message while some time
  945. consuming process is underway and then erase the message after the
  946. process is done but without any action required from the user.
  947.  
  948. -------------------------------------------------------------------
  949. int RadioButtonSetting(DBOX *db, enum commands cmd)
  950.  
  951. This function returns true if the specified command on the specified
  952. dialog box is a pressed radio button.
  953.  
  954. -------------------------------------------------------------------
  955. void EnableButton(DBOX *db, enum commands cmd)
  956.  
  957. This function enables a command button on a dialog box. command
  958. buttons are initially enabled when the dialog box is first opened.
  959.  
  960. -------------------------------------------------------------------
  961. void DisableButton(DBOX *db, enum commands cmd)
  962.  
  963. This function disables a command button on a dialog box. command
  964. buttons are initially enabled when the dialog box is first opened.
  965.  
  966. -------------------------------------------------------------------
  967. void PushRadioButton(DBOX *db, enum commands cmd)
  968.  
  969. This function presses the specified radio button command on the
  970. specified dialog box.
  971.  
  972. -------------------------------------------------------------------
  973. void PutItemText(WINDOW wnd, enum commands cmd, char *text)
  974.  
  975. This function appends a line of text to a TEXT, TEXTBOX, EDITBOX,
  976. LISTBOX, SPINBUTTON, or COMBOBOX control window in a dialog box. The
  977. wnd parameter is the WINDOW handle of the dialog box. The cmd
  978. parameter specifies the command associated with the control item. The
  979. text parameter points to the text to be added. The control window
  980. makes its own copy of the text, so the caller's copy can go out of
  981. scope.  If the control window is a COMBOBOX, TEXTBOX, or EDITBOX
  982. window, you must send a PAINT message to the control window so that
  983. the new text will display.
  984.  
  985. You must call this function while the dialog box is active. That
  986. means that if the dialog box is modal, you must call this function
  987. from within a custom window processing function that you supply when
  988. you call DialogBox.
  989.  
  990. -------------------------------------------------------------------
  991. void PutComboListText(WINDOW wnd, enum commands cmd, char *text)
  992.  
  993. This function appends a line of text to the LISTBOX of a COMBOBOX
  994. control window in a dialog box. The wnd parameter is the WINDOW
  995. handle of the dialog box. The cmd parameter specifies the command
  996. associated with the combo box. The text parameter points to the
  997. text to be added. The control window makes its own copy of the text,
  998. so the caller's copy can go out of scope.
  999.  
  1000. You must call this function while the dialog box is active. That
  1001. means that if the dialog box is modal, you must call this function
  1002. from within a custom window processing function that you supply when
  1003. you call DialogBox.
  1004.  
  1005. -------------------------------------------------------------------
  1006. void GetItemText(WINDOW wnd, enum commands cmd, char *text, int length)
  1007.  
  1008. This function copies the text from a TEXT, TEXTBOX, COMBOBOX, or
  1009. EDITBOX control window in a dialog box. The wnd parameter is the
  1010. WINDOW handle of the dialog box. The cmd parameter specifies the
  1011. command associated with the control item. The text parameter points
  1012. to the caller's buffer where the text will be copied. The length
  1013. parameter specifies the maximum number of characters to copy.
  1014.  
  1015. You must call this function while the dialog box is active. That
  1016. means that if the dialog box is modal, you must call this function
  1017. from within a custom window processing function that you supply when
  1018. you call DialogBox.
  1019.  
  1020. -------------------------------------------------------------------
  1021. char *GetEditBoxText(DBOX *db, enum commands cmd)
  1022.  
  1023. This function returns a pointer to the text associated with an
  1024. editbox control in a dialog box. You can call it after the dialog box
  1025. has completed processing. The buffer is on the heap. Do not free it.
  1026. Instead, call SetEditBoxText with a NULL pointer.
  1027.  
  1028. If the text has not changed since it was initialized, this function
  1029. returns NULL.
  1030.  
  1031. -------------------------------------------------------------------
  1032. char *GetComboBoxText(DBOX *db, enum commands cmd)
  1033.  
  1034. This function returns a pointer to the text associated with an
  1035. combo box control in a dialog box. You can call it after the dialog box
  1036. has completed processing. The buffer is on the heap. Do not free it.
  1037. Instead, call SetEditBoxText with a NULL pointer.
  1038.  
  1039. If the text has not changed since it was initialized, this function
  1040. returns NULL.
  1041.  
  1042. -------------------------------------------------------------------
  1043. void SetEditBoxText(DBOX *db, enum commands cmd, char *text)
  1044.  
  1045. This function sets the text of a dialog box editbox. You can call
  1046. this function before or while the dialog box is open. The dialog box
  1047. makes it own copy on the heap, so your text can go out of scope.
  1048.  
  1049. -------------------------------------------------------------------
  1050. void SetComboBoxText(DBOX *db, enum commands cmd, char *text)
  1051.  
  1052. This function sets the text of a dialog box combo box. You can call
  1053. this function before or while the dialog box is open. The dialog box
  1054. makes it own copy on the heap, so your text can go out of scope.
  1055.  
  1056. -------------------------------------------------------------------
  1057. char *GetDlgText(DBOX *db, enum commands cmd, char *text)
  1058.  
  1059. Similar to GetEditBoxText except that it works with text controls.
  1060.  
  1061. -------------------------------------------------------------------
  1062. char *SetDlgText(DBOX *db, enum commands cmd, char *text)
  1063.  
  1064. Similar to SetEditBoxText except that it works with text controls.
  1065.  
  1066. -------------------------------------------------------------------
  1067. char *GetDlgTextBox(DBOX *db, enum commands cmd, char *text)
  1068.  
  1069. Similar to GetEditBoxText except that it works with textbox controls.
  1070.  
  1071. -------------------------------------------------------------------
  1072. char *SetDlgTextBox(DBOX *db, enum commands cmd, char *text)
  1073.  
  1074. Similar to SetEditBoxText except that it works with textbox controls.
  1075.  
  1076. -------------------------------------------------------------------
  1077. void SetCheckBox(DBOX *db, enum commands cmd)
  1078. void ClearCheckBox(DBOX *db, enum commands cmd)
  1079. int CheckBoxSetting(DBOX *db, enum commands cmd)
  1080.  
  1081. These functions set, clear, and test the setting of a specified check
  1082. box control item on a dialog box.
  1083.  
  1084. -------------------------------------------------------------------
  1085. void LoadHelpFile(char *expath);
  1086.  
  1087. This function loads the help file named by the DFLAT_APPLICATION
  1088. global constant with the .HLP file extension. The expath parameter
  1089. points to the DOS path where the file can be found.
  1090.  
  1091. Call this function at the beginning of an application program.
  1092.  
  1093. -------------------------------------------------------------------
  1094. void UnLoadHelpFile(void);
  1095.  
  1096. Call this function at the end of a D-Flat application to free the
  1097. memory used by a help file.
  1098.  
  1099. -------------------------------------------------------------------
  1100. void SearchText(WINDOW wnd)
  1101.  
  1102. Opens a dialog box for the user to enter a search string. Searches
  1103. the wnd TEXTBOX for a match on the string.
  1104.  
  1105. -------------------------------------------------------------------
  1106. void ReplaceText(WINDOW wnd)
  1107.  
  1108. Opens a dialog box for the user to enter search and replacement
  1109. strings. Searches the wnd TEXTBOX for a match on the string and
  1110. replaces it if found. The dialog box includes an option to replace
  1111. all matches.
  1112.  
  1113. -------------------------------------------------------------------
  1114. void SearchNext(WINDOW wnd)
  1115.  
  1116. Assumes that a previous SearchText call has found a match. Searches
  1117. for the next match of the same string in the specified EDITBOX
  1118. window.
  1119.  
  1120. -------------------------------------------------------------------
  1121. void WriteTextLine(WINDOW wnd, RECT *rcc, int y, int reverse)
  1122.  
  1123. This function displays a text line from a TEXTBOX or derived window
  1124. class. The text has already been added to the window with ADDTEXT,
  1125. etc. The y parameter specifies which line (0, 1, ...) relative to the
  1126. window's text buffer to display. If the specified line is not in
  1127. view, the function does nothing. If the reverse parameter is true,
  1128. the line displays in the reverse-video colors of the window. The rcc
  1129. RECT pointer is usually NULL for applications calls. It points to a
  1130. rectangle relative to the window outside of which displays will not
  1131. occur. 
  1132.  
  1133. -------------------------------------------------------------------
  1134. void PutWindowLine(WINDOW wnd, void *s, int x, int y)
  1135.  
  1136. This function writes a line of text to a window. The x and y
  1137. coordinates point to the first character in the window's client area
  1138. where the line is to be written. The text must be null-terminated.
  1139. This function clips the line if it goes beyond the window or the
  1140. screen. The function clips the line if it goes outside the borders of
  1141. the window's parent. If other windows overlap the target window, the
  1142. text is clipped. Do not use negative values in x or y.
  1143.  
  1144. You can assign color values to the global variables foreground and
  1145. background to affect the color of the line's display.
  1146.  
  1147. -------------------------------------------------------------------
  1148. void PutWindowChar(WINDOW wnd, int c, int x, int y)
  1149.  
  1150. This function writes the character c to a window. The x and y
  1151. coordinates are relative to the window's client area.
  1152.  
  1153. The function performs clipping. If the character is beyond the
  1154. window's or the screen's borders it is not written. If the window
  1155. does not have the NOCLIP attribute, the character is not written if
  1156. its coordinates are beyond the margins of its parent window (if the
  1157. window has a parent). If other windows overlap the target window, the
  1158. text is clipped. Do not use negative values in x or y.
  1159.  
  1160. You can assign color values to the global variables foreground and
  1161. background to affect the color of the character's display.
  1162.  
  1163. -------------------------------------------------------------------
  1164. void DrawVector(WINDOW wnd, int x, int y, int len, int hv)
  1165.  
  1166. Draw a horizontal vector in a picture box. x and y are character
  1167. coordinates relative to the starting position of the vector. len is
  1168. the length. hv is TRUE for a horizontal vector and FALSE for a
  1169. vertical vector. Sends a DRAWVECTOR message to the window.
  1170.  
  1171. Send a PAINT message to the window to display the vectors.
  1172.  
  1173. -------------------------------------------------------------------
  1174. void DrawBox(WINDOW wnd, int x, int y, int ht, int wd)
  1175.  
  1176. Draw a box in a picture box. x and y are character coordinates
  1177. relative to the upper left corner of the box. ht and wd are the
  1178. height and width of the box. Sends a DRAWBOX message to the window.
  1179.  
  1180. Send a PAINT message to the window to display the box.
  1181.  
  1182. -------------------------------------------------------------------
  1183. void DrawBar(WINDOW wnd, enum VectTypes vt, int x, int y, int len, int hv)
  1184.  
  1185. Draw a graph bar in a picture box. vt is one of the following values
  1186. to specify the character box used to display the bar: SOLIDBAR,
  1187. HEAVYBAR, CROSSBAR, LIGHTBAR. x and y are character coordinates
  1188. relative to the starting position of the bar. len is the length. hv
  1189. is TRUE for a horizontal bar and FALSE for a vertical bar. Sends a
  1190. DRAWBAR message to the window.
  1191.  
  1192. Send a PAINT message to the window to display the bars.
  1193.  
  1194. -------------------------------------------------------------------
  1195. void WindowClientColor(WINDOW wnd, int fg, int bg)
  1196.  
  1197. Changes the window client space's foreground and background colors.
  1198. -------------------------------------------------------------------
  1199. void WindowReverseColor(WINDOW wnd, int fg, int bg)
  1200.  
  1201. Changes the window's foreground and background reverse colors, which
  1202. are used to display such things as selected text blocks.
  1203. -------------------------------------------------------------------
  1204. void WindowFrameColor(WINDOW wnd, int fg, int bg)
  1205.  
  1206. Changes the window's foreground and background frame colors.
  1207. -------------------------------------------------------------------
  1208. void WindowHighlightColor(WINDOW wnd, int fg, int bg)
  1209.  
  1210. Changes the window's foreground and background highlight colors,
  1211. which are used to display highlighted items such as menu selector
  1212. bars.
  1213. -------------------------------------------------------------------
  1214. void MarkTextBlock(WINDOW wnd, int BegLine, int BegCol,
  1215.                                int EndLine, int EndCol)
  1216.  
  1217. Marks a block in the specified TEXTBOX window.
  1218.  
  1219. -------------------------------------------------------------------
  1220. void ClearTextBlock(WINDOW wnd)
  1221.  
  1222. Unmarks a marked block in the specified TEXTBOX window.
  1223.  
  1224. -------------------------------------------------------------------
  1225. void CopyToClipboard(WINDOW wnd)
  1226.  
  1227. Copies a marked block from the specified TEXTBOX window into the
  1228. Clipboard.
  1229.  
  1230. -------------------------------------------------------------------
  1231. void PasteFromClipboard(WINDOW wnd)
  1232.  
  1233. Pastes the Clipboard's contents into the specified EDITBOX window at
  1234. the current cursor location.
  1235.  
  1236. -------------------------------------------------------------------
  1237. Configurable Items
  1238.  
  1239. Global Symbol File      Value Description
  1240. ------------- --------- ----- ---------------------------------------
  1241. MAXMESSAGES   DFLAT.H    50   Maximum D-Flat messages queued
  1242. MAXCONTROLS   DIALBOX.H  26   Maximum Controls on a dialog box
  1243. MAXRADIOS     DIALBOX.H  20   Maximum radio buttons in a group
  1244. MAXSAVES      SYSTEM.H   50   Maximum cursor saves
  1245. MAXPULLDOWNS  MENU.H     10   Maximum number of pull-down menus on
  1246.                               a menu bar
  1247. MAXSELECTIONS MENU.H     15   Maximum number of selections on 
  1248.                               a pull-down menu (includes separators)
  1249. MAXCASCADES   MENU.H      3   Maximum nesting level of cascaded menus
  1250.